﻿using Architecture.Domain.Service;
using Architeture.Domain.DTO;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class MenuSelectCommandHandler : IRequestHandler<MenuSelectCommand, MenuPage>
    {
        protected readonly IMenuSerivice serivice;

        public MenuSelectCommandHandler(IMenuSerivice serivice)
        {
            this.serivice = serivice;
        }

        public async Task<MenuPage> Handle(MenuSelectCommand request, CancellationToken cancellationToken)
        {
            return await serivice.GetMenuAll(request.pageindex, request.pagesize, request.name);
        }
    }
}
